package com.example.tests;

public class PrintPhonesData implements Comparable<PrintPhonesData>
{
	private String fullName;
	private String phoneHome;
	private String fullData;

	public PrintPhonesData()
	{

	}

	public PrintPhonesData(String fullName, String phoneHome)
	{
		this.fullName = fullName;
		this.phoneHome = phoneHome;
	}

	public PrintPhonesData withFullName(String fullName)
	{
		this.fullName = fullName;
		return this;
	}

	public PrintPhonesData withPhoneHome(String phoneHome)
	{
		this.phoneHome = phoneHome;
		return this;
	}

	public String getFullName()
	{
		return fullName;
	}

	public String getPhoneHome()
	{
		return phoneHome;
	}

	public String getFullData()
	{
		return fullName + " : " + phoneHome;
	}

	@Override
	public String toString()
	{
		return "PrintPhonesData [fullData=" + fullData + "]";
	}

	@Override
	public int hashCode()
	{
		// final int prime = 31;
		int result = 1;
		// result = prime * result + ((fullData == null) ? 0 : fullData.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PrintPhonesData other = (PrintPhonesData) obj;
		if (fullData == null)
		{
			if (other.fullData != null)
				return false;
		}
		else if (!fullData.equals(other.fullData))
			return false;
		return true;
	}

	@Override
	public int compareTo(PrintPhonesData other)
	{
		return this.getFullData().toLowerCase().compareTo(other.getFullData().toLowerCase());
	}
}
